<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Flash Memory (AR6410/AR7420)</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch04.html" title="Chapter 4.  Firmware"><link rel="prev" href="ch04s16.html" title="Boot from Host (AR7420)"><link rel="next" href="ch05.html" title="Chapter 5.  Procedures"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
			Flash Memory (AR6410/AR7420)
			</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch04s16.html">Prev</a> </td><th width="60%" align="center">Chapter 4. 
		Firmware 
		</th><td width="20%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr></table><hr></div><div class="section" title="Flash Memory (AR6410/AR7420)"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="firmware-AR7420-flash"></a>
			Flash Memory (AR6410/AR7420)
			</h2></div></div></div><p>
			The <code class="constant">VS_MODULE_OPERATION</code> message is now the only way of write flash memory. The legacy message types <code class="constant">VS_RD_MOD</code>, <code class="constant">VS_WR_MOD</code>, <code class="constant">VS_MOD_NVM</code> and <code class="constant">VS_PTS_NVM</code> are deprecated and will no longer be supported by runtime firmware. This means that some customers must re-write their applications to flash newer powerline devices.
			</p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>
			The <code class="constant">VS_MODULE_OPERATION</code> message type has many formats and the structure differs with each format. Readers should consult the <em class="citetitle">QCA Firmware Technical Reference Manual</em> for a complete description.
				</p></div><p>
				A blank flash memory must first be programmed with a softloader module. The module consists of a manifest, the executable softloader program image and a flash memory map. The map is used to manage flash memory during initializations and upgrades. The softloader module must be written into flash memory as a separate module before parameter and firmware modules are written. After that, parameter and firmware modules may be written and re-written without re-writing the softloader module. Of course, the softloader module must be re-written if flash memory is erased. 
				</p><div class="figure"><a name="idp21779808"></a><p class="title"><b>Figure 4.9. 
				Flashing the Softloader (AR7420)
				</b></p><div class="figure-contents"><pre class="programlisting">

   AR7420                                        LOCAL-HOST
 [02] |&lt;- VS_MODULE_OPERATION.REQ (Start Session) ---| [01]
 [03] |-- VS_MODULE_OPERATION.CNF (Start Session) --&gt;| [04]
      |                                              |
 [06] |&lt;-- VS_MODULE_OPERATION.REQ (Write Module) ---| [05]
 [07] |--- VS_MODULE_OPERATION.CNF (Write Module) --&gt;| [08]
      |&lt;---------------------------------------------|     
      |---------------------------------------------&gt;|     
      |                                              |
 [10] |&lt;- VS_MODULE_OPERATION.REQ (Close Session) ---| [09]
 [11] |-- VS_MODULE_OPERATION.CNF (Close Session) --&gt;| [12]

 </pre></div></div><br class="figure-break"><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
					The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write session request to register a session identifier and the module identifier, module length and module checksum of the softloader module. The softloader module identifier is <code class="constant">0x7003</code>. The softloader module is the entire softloader chain including manifest, softloader image and flash memory layout.
					</p></li><li class="listitem"><p>
					The device receives the request, validates the module identifier and preserves the module length and checksum until the module write session is closed. The local host has <code class="constant">30</code> minutes to complete registered module write operations and close the module write session.
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code>, if things went well.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and prepares to download the softloader module.
					</p></li><li class="listitem"><p>
					The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
					</p></li><li class="listitem"><p>
				 	The device receives the request and write to a scrath region of flash memory awaiting session close.	
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and continues downloading the softloader in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
					</p></li><li class="listitem"><p>
					The local host send a <code class="constant">VS_MODULE_OPERATION.REQ</code> close module write session request having <code class="varname">COMMIT_CODE</code> bits <code class="constant">0</code> and <code class="constant">1</code> set. to indicate <span class="quote">“<span class="quote">Force Commit</span>”</span> and <span class="quote">“<span class="quote">Commit without reset</span>”</span>, respectively.
					</p></li><li class="listitem"><p>
					The device recevies the request, verifies the module length and checksum then transfers the module from scratch memory to it's final location in flash memory.
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> close module write session with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well. If things did not go well then the local host must request a new write module session and start over.
					</p></li></ol></div><p>
				Once the softloader module is written, the parameter and firmware modules may be written in much the same way except that they must be written as a pair. The parameter module must be downloaded first. The firmware module cannot be committed to without a compatible parameter module. 
				</p><p>
		When parameters and firmware are written together the User <acronym class="acronym">PIB</acronym>, Factory <acronym class="acronym">PIB</acronym> and firmware are modified modified. The new User <acronym class="acronym">PIB</acronym> is created by copying the old User <acronym class="acronym">PIB</acronym> over the new one. Consequently the only change comes from extra fields found at the end of the new User <acronym class="acronym">PIB</acronym>. The new Factory <acronym class="acronym">PIB</acronym> becomes the new User <acronym class="acronym">PIB</acronym> with certain fields from the old User <acronym class="acronym">PIB</acronym> preserved, such as the <acronym class="acronym">MAC</acronym>, <acronym class="acronym">DAK</acronym> and so on.
			</p><div class="figure"><a name="idp21795360"></a><p class="title"><b>Figure 4.10. 
				Flash Parameters and Firmware (AR7420)
				</b></p><div class="figure-contents"><pre class="programlisting">

       AR7420                                      LOCAL-HOST
    [02] |&lt;- VS_MODULE_OPERATION.REQ (start session) ---| [01]
    [03] |-- VS_MODULE_OPERATION.CNF (start session) --&gt;| [04]
         |                                              |
    [06] |&lt;-- VS_MODULE_OPERATION.REQ (write module) ---| [05]
    [07] |--- VS_MODULE_OPERATION.CNF (write module) --&gt;| [08]
         |&lt;---------------------------------------------|
         |---------------------------------------------&gt;|
         |                                              |
    [10] |&lt;-- VS_MODULE_OPERATION.REQ (write module) ---| [09]
    [11] |--- VS_MODULE_OPERATION.CNF (write module) --&gt;| [12]
         |&lt;---------------------------------------------|
         |---------------------------------------------&gt;|
         |                                              |
    [14] |&lt;- VS_MODULE_OPERATION.REQ (commit modules) --| [13]
    [15] |-- VS_MODULE_OPERATION.CNF (commit modules) -&gt;| [16]

 </pre></div></div><br class="figure-break"><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><p>
				The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write session request to register the session identifier, module identifiers, module lengths and module checksums. In this case, the two modules are the runtime parameters and runtime firmware. The module identifiers are <code class="constant">0x7002</code> and <code class="constant">0x7003</code>, respectively. The application running on the local must must locate these modules and determine their size and checksum.
				</p></li><li class="listitem"><p>
					The device receives the request, validates the module identifier and preserves the module lengths and checksums until the module write session is closed. The local host has <code class="constant">30</code> minutes to complete registered module write operations and close the module write session.
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code>, if things went well.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and prepares to download the parameter module.
					</p></li><li class="listitem"><p>
					The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
					</p></li><li class="listitem"><p>
				 	The device receives the request and write to a scratch region of flash memory awaiting write session close.	
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and continues downloading the parameter module in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and prepares to download the firmware module.
					</p></li><li class="listitem"><p>
					The local host sends a <code class="constant">VS_MODULE_OPERATION.REQ</code> module write request containing the offset, length and content of the first portion of the module being downloaded.
					</p></li><li class="listitem"><p>
				 	The device receives the request and write to a scratch region of flash memory awaiting write session close.	
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well.
					</p></li><li class="listitem"><p>
					The local host receives the confirmation and continues downloading the firmware module in fragments using <code class="constant">VS_MODULE_OPERATION</code> write requests, advancing the offset and adjusting the length with each write.
					</p></li><li class="listitem"><p>
					The local host send a <code class="constant">VS_MODULE_OPERATION.REQ</code> close module write session request having <code class="varname">COMMIT_CODE</code> bits <code class="constant">0</code> and <code class="constant">1</code> set. to indicate <span class="quote">“<span class="quote">force commit</span>”</span> and <span class="quote">“<span class="quote">commit without reset</span>”</span>, respectively.
					</p></li><li class="listitem"><p>
					The device receives the request, verifies the module length and checksum then transfers the module from scratch memory to it's final location in flash memory.
					</p></li><li class="listitem"><p>
					The device responds with <code class="constant">VS_MODULE_OPERATION.CNF</code> close module write session with <code class="varname">MSTATUS</code> set to <code class="constant">0</code> if things went well. If things did not go well then the local host must request a new write module session and start over.
					</p></li></ol></div><p>
		At this point, the device is ready to boot from flash memory if the power fails or the device resets.
		</p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch04s16.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch04.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
			 Boot from Host (AR7420)
			 </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. 
		Procedures 
		</td></tr></table></div></body></html>
